package com.zllkj.mm.api.net;


import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import rx.Observable;
import rx.Subscriber;

/**
 * 测试接口请求数据
 */
public class UploadPost extends BaseEntity {
    //    回调sub
    private Subscriber mSubscriber;
    private String sign;
    private String token;
    private RequestBody download;
    //    MultipartBody.Part download;
    MultipartBody multipartBody;
//    private String noncestr = createRandom(false, 9);

    private String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
    public UploadPost(Subscriber mSubscriber, /*String token,*/ RequestBody download) {
        this.mSubscriber = mSubscriber;
//        this.token = token;
//        this.multipartBody = multipartBody;
        this.download = download;
//        // 创建参数表
//        Map<String, String> paramMap = new HashMap<>();
////        paramMap.put("sign", sign);
//        paramMap.put("token", token);        paramMap.put("noncestr", noncestr);
//        paramMap.put("timestamp", timestamp);
//        this.sign = NetTools.sign(Constants.APP_SECRET, paramMap);
    }

    @Override
    public Observable getObservable(HttpService httpService) {
        return httpService.upload(download
        );
    }

    @Override
    public Subscriber getSubscirber() {
        return mSubscriber;
    }

}